/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package koor.entity;

import java.util.LinkedHashSet;
import javax.persistence.*;

/**
 *
 * @author Admin
 */
@Entity
@Table(name = "department")
public class Department extends AbstractEntity{
    
    @Column(name = "title")
    private String title;
    
    @OneToMany(mappedBy = "subject", cascade=CascadeType.ALL, fetch = FetchType.LAZY)
    private LinkedHashSet<Subject> subjects;

    public Department() {
    }

    public Department(String title) {
        this.title = title;
    }

    public Department(String title, int id) {
        super(id);
        this.title = title;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public LinkedHashSet<Subject> getSubjects() {
        return subjects;
    }

    public void setSubjects(LinkedHashSet<Subject> subjects) {
        this.subjects = subjects;
    }

}
